<!--{template control/admin/tpl/admin_header}-->
<div class="page_title">
    <h1>{$model_info['model_name']}{$_lang['manage']}</h1>
    <div class="tool">
        <a href="index.php?do=model&model_id={$model_id}&view=list" class="here">{$_lang['task_list']}</a>
		<!--<a href="index.php?do=model&model_id={$model_id}&view=config">{$_lang['task_config']}</a>-->
    </div>
</div>
<div class="box search p_relative">
    <div class="title">
        <h2>{$_lang['search']}</h2>
    </div>
    <div class="detail" id="detail">
        <form action="index.php?do={$do}&model_id={$model_id}&view=list" method="post" id=frm_user_search>
        	<input type="hidden" value="{$page}" name="page">
        	 <table cellspacing="0" cellpadding="0">
        	 	
                <tbody>
                    <tr>
                        <th>
                            {$_lang['task']}
                        </th>
                        <td>
                            <input type="text" value="{$task_id}" name="w[task_id]" class="txt" onkeyup="clearstr(this);"/>
                        </td>
                        <th>
                            {$_lang['task_title']}
                        </th>
                        <td>
                            <input type="text" value="{$task_title}" name="w[task_title]" class="txt" />{$_lang['search_by_like']}
                        </td>
                        <th>
                            {$_lang['task_status']}
                        </th>
                        <td>
                            <select class="ps vm" name="w[task_status]" id="catid">
                                <option value="" {if $w[task_status]==n}selected="selected"{/if}>{$_lang['without_payment']}</option>
                                {loop $task_status $key $v}
                                {if $key>=1}<option value="$key" {if $w[task_status]==$key}  selected="selected"{/if}>$v  </option>
                                {/if}
                                {/loop}
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th>
                           {$_lang['result_order']}
                        </th>
                        <td>
                           <select name="w[ord][]">
                           <option value="task_id" {if $w[ord][0]=='task_id' or !isset($w[ord][0])} selected="selected"{/if}>{$_lang['default']}{$_lang['order']}</option>
                           <option value="end_time" {if $w[ord][0]=='end_time' } selected="selected"{/if}>{$_lang['expiration_time']}</option>
                      </select>
                      <select name="w[ord][]">
                            <option {if $w[ord][1]=='desc' or !isset($w[ord][1])}selected="selected" {/if} value="desc">{$_lang['desc']}</option>
                            <option {if $w[ord][1]=='asc'}selected="selected" {/if} value="asc">{$_lang['asc']}</option>
                      </select>
                       </td>
                        <th>
                                                    {$_lang['list_result']}
                         </th>
                        <td>
                            <select name="w[page_size]">
                               <option value="10" {if $w[page_size]=='10'}selected="selected"{/if}>{$_lang['page_size']}10</option>
                               <option value="20" {if $w[page_size]=='20'}selected="selected"{/if}>{$_lang['page_size']}20</option>
                               <option value="30" {if $w[page_size]=='30'}selected="selected"{/if}>{$_lang['page_size']}30</option>
                             </select>
                             <button class="pill" type="submit" value={$_lang['search']} name="sbt_search">
                                <span class="icon magnifier">&nbsp;</span>{$_lang['search']}
                              </button>
                           </td>
                        </tr>
                  </tbody>
            </table>
        </form>
    </div>
 </div>
<!--搜索结束-->
<div class="box list">
    <div class="title">
        <h2>{$_lang['task_manage']}</h2>
    </div>
     <div class="detail">
        <form action="index.php?do={$do}&model_id={$model_id}&view=list" method="post" id="frm_list">
		 	<input type="hidden" value="{$page}" name="page">
		 	<input type="hidden" name="w[page_size]" value="{$page_size}">
		 	<div id="ajax_dom">
		 	<input type="hidden" value="{$page}" name="page"/>
		  <table cellpadding="0" cellspacing="0">
             <tbody>
                 <tr>
                    <th width="10%">
                     ID
                     </th>
                      <th width="22%">
                                                                {$_lang['task_title']}
                       </th>
                           <th width="10%">
                                                               {$_lang['pub_name']}
                       </th>
                      <th width="20%">
                                                                {$_lang['task_cash']}
                       </th>
                       <th width="9%">
                                                                {$_lang['task_status']}
                        </th>
                        <th width="14%">
                                                                {$_lang['expiration_time']}
                        </th>
                        <th width="20%">
                                                                {$_lang['operate']}
                        </th>
                     </tr>
                       {loop $task_arr $k $v}
                         <tr class="item">
                           
                            <td class="td25">
                               <input type="checkbox" name="ckb[]" class="checkbox" value="{$v[task_id]}">{$v[task_id]}
                             </td>
                           <td >
                                <a href="../../index.php?do=task&task_id={$v['task_id']}" target="_blank">
                                	<!--{eval echo(kekezu::cutstr($v[task_title],36));}--></a>
									{if $v[is_top]==1}<font color="red">{$_lang['recommended']}</font>{/if}
                            </td>
                            <td>
                               {$v[username]}
                             </td>
                            <td>
                            
                                {c:$cash_rule_arr[$v[task_cash_coverage]][start_cove]}-{c:$cash_rule_arr[$v[task_cash_coverage]][end_cove]}
                            </td>
                            <td>
                                {if $v[task_status]==0}{$_lang['without_payment']}{elseif $v[task_status]==1}{$_lang['pending']}{elseif $v[task_status]==2}{$_lang['in_bidding']}{elseif $v[task_status]==3}{$_lang['standard_selection_in']}
								{elseif $v[task_status]==4}{$_lang['to_be_managed']}{elseif $v[task_status]==6}{$_lang['delivery_of']}{elseif $v[task_status]==7}{$_lang['freezing_process']}
								{elseif $v[task_status]==8}{$_lang['has_ended']}{elseif $v[task_status]==9}{$_lang['has_fail']}{elseif $v[task_status]==10}{$_lang['nopass']}
								{elseif $v[task_status]==11}{$_lang['in_the_arbitration']}{/if}
                            </td>
                             <td>
                                 <!--{date('Y-m-d H:i',$v[end_time])}-->
                              </td>
                             <td>
                             	{if $v[task_status]==1}
							  		<a href="index.php?do=model&model_id=$model_id&view=list&ac=pass&task_id={$v[task_id]}&page={$page}" class="button"><span class="cog icon"></span>{$_lang['audit']}</a>
      								<a href="index.php?do=model&model_id=$model_id&view=list&ac=nopass&task_id={$v[task_id]}&page={$page}" class="button"><span class="cross icon"></span>{$_lang['audit_not_passed']}</a>
								{/if}
								{if in_array($v[task_status],array('2','3','4','5'))}
									<a href="index.php?do=model&model_id=$model_id&view=list&ac=freeze&task_id={$v[task_id]}&page={$page}" class="button"><span class="corss icon"></span>{$_lang['freeze']}</a>
								{/if}
								{if $v[is_top]!=1 && in_array($v[task_status],array('2','3'))}
								<a href="index.php?do=model&model_id=$v[model_id]&view=list&id=$v[task_id]&ac=recommend&page={$page}&task_id=$v[task_id]" class="button"><span class="cog icon"></span>{$_lang['recommend']}</a>
								{/if}
								{if $v[task_status]==7}
									<a href="index.php?do=model&model_id=$model_id&view=list&ac=unfreeze&task_id={$v[task_id]}&page={$page}" class="button"><span class="cog icon"></span>{$_lang['unfreeze']}</a>
								{/if}
								{if $v[is_top]==1}
									<a href="index.php?do=model&model_id=$model_id&view=list&ac=unrecommend&task_id={$v[task_id]}&page={$page}" class="button"><span class="cog icon"></span>{$_lang['cancel_recommend']}</a>
								{/if}
									<a href="index.php?do=model&model_id=$model_id&view=edit&task_id={$v[task_id]}&page={$page}" class="button dbl_target"><span class="pen icon"></span>{$_lang['edit']}</a>
								{if in_array($v[task_status],array('6','8','9','10'))}
									<a href="index.php?do=model&model_id=$model_id&view=list&ac=del&task_id={$v[task_id]}&page={$page}" onclick="return cdel(this);" class="button"><span class="trash icon"></span>{$_lang['delete']}</a>
						   		 {/if}
							</td>
                         </tr>
						{/loop}
						<tr>
                           <td colspan="7">
                               <div class="page fl_right">
                                   {$pages[page]}
                               </div>
                           <div class="clearfix">
                                <input type="checkbox" onclick="checkall();" id="checkbox" name="checkbox"/>
                                 <label for="checkbox">
                                                                {$_lang['select_all']}
                             </label>     <input type="hidden" name="sbt_action" class="sbt_action"/>
	                        <button type="submit" value="{$_lang['mulit_delete']}" onclick="return batch_act(this,'frm_list');" class="pill negative" ><span class="icon trash"></span>{$_lang['mulit_delete']}</button>
	                        <button type="submit" value="{$_lang['mulit_pass']}" onclick="return batch_act(this,'frm_list');"  class="positive pill negative"><span class="icon check">&nbsp;</span>{$_lang['mulit_pass']}</button>
	                    	<button type="submit" value="{$_lang['mulit_freeze']}" onclick="return batch_act(this,'frm_list');"    class="pill negative" ><span class="lock icon"></span>{$_lang['mulit_freeze']}</button>
							<button type="submit" class="positive pill negative"  onclick="return batch_act(this,'frm_list');" value="{$_lang['mulit_unfreeze']}"><span class="unlock icon"></span>{$_lang['mulit_unfreeze']}</button>
						</div>
                         </td>
                   </tr>
                </tbody>
        </table></div>
       </form>
     </div>
</div>
<!--{template control/admin/tpl/admin_footer}-->
